/**
 * 
 */
package com.gragra.nounIdentification;
/**
 * this implementation of the ConvergenceAssessment interface can be used to assert convergence once a given
 * number of frames has been suggested to belong the the word class in question may never decide that
 * convergence has been reached if there are never enough frames for that
 * @author Christoph Teichmann
 * created Mar 26, 2013 10:37:03 AM
 * @version 0.1
 */
public class ConvergenceBySizeOfFrames implements ConvergenceAssessment
{
	/**
	 * constructs a new instance with the given limit for frames found during training
	 * @param max
	 */
	public ConvergenceBySizeOfFrames(int max)
	{this.max = max;}
	/**
	 * the maximum number of frames to be found
	 */
	private final int max;
	/* (non-Javadoc)
	 * @see com.gragra.nounIdentification.ConvergenceAssessment#hasConverged(int, com.gragra.nounIdentification.NounIdentifier)
	 */
	@Override
	public boolean hasConverged(int iterations, NounIdentifier nounIdentifier)
	{return nounIdentifier.numberOfFrames() > max;}
}